home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / gnu / a2_0bEmacs_bin.lha / Emacs-19.25 / amiga.doc < prev    next >
Lisp/Scheme  |  1992-10-01  |  22KB  |  566 lines

  1. 1. Introduction
  2. ---------------
  3.  
  4. Emacs is a powerful, but sometimes cryptic, editor. In this Amiga
  5. version, I have tried to make it easier to use with menus, mouse
  6. support and arrow key support, but it still requires some getting used
  7. to. I would recommend starting with the tutorial, which can be started
  8. from the Help menu (if it is missing, you didn't install emacs
  9. correctly. Check that the file s:.emacs-menu.el exists) or from the
  10. keyboard by typing Control-H and then t.
  11.  
  12. This file only describes the Amiga specific features of emacs, and it
  13. assumes a working knowledge of emacs. For more documentation you can
  14. consult the emacs help (Information in the Help menu, or C-h i) or
  15. read the emacs manual (which is the same document in a printed form).
  16. This manual can be bought from the
  17.  
  18.      Free Software Foundation
  19.      675 Mass Ave
  20.      Cambridge, MA 02139
  21.      USA
  22.  
  23. See the file gnuemacs:etc/DISTRIB for more information (you can type
  24. C-h C-d to view it).
  25.  
  26. To install emacs, read the file INSTALLATION.
  27.  
  28.  
  29. 2. Changes since the last version
  30. ---------------------------------
  31.  
  32. Several features have been added since v1.25:
  33.  
  34. - workbench support.
  35. - asynchronous processes can be run in emacs, so the shell & compile
  36.   commands now work.
  37. - startup problems (missing libraries, no memory, etc) should now
  38.   be reported (there is one exception: if run under any version
  39.   before 2.04, emacs will fail silently).
  40. - the emacs window can be configured in s:.emacs without causing
  41.   nasty visual effects (the window opens directly where you wanted,
  42.   with the correct size, fonts, etc).
  43. - the numeric keypad keys can now be defined separately from the
  44.   equivalent keys on the main keyboard.
  45. - the 'ctrl-g' interrupt key now works far better (it can
  46.   interrupt run-away lisp code).
  47. - the -t startup option has been renamed as -dev.
  48. - the keyboard sequences generated for amiga specific features
  49.   (eg function & arrow keys) have changed (these used to start
  50.   with C-\. This has been replaced by the C-x C-^ sequence, for
  51.   very good reasons).
  52. - last redisplay bug squashed !
  53.  
  54. Numerous other bugs have also been destroyed ...
  55.  
  56.  
  57. 3. Using emacs in a window
  58. --------------------------
  59.  
  60. Emacs runs in a window on the Workbench (this can be changed). It
  61. basically works like just any other version of GNU Emacs, using the
  62. same keys, etc. It uses the standard amiga keymap, but with some strange
  63. modifications:
  64.  
  65. o The left alt key is stolen as a meta key for emacs. This means you can't use
  66. it to enter accents. However, the right alt key remains untouched. Hence
  67. 'left alt-f e' moves forward one word and inserts an e, while
  68. 'right alt-f e' inserts an e acute. In the rest of the text, the meta key
  69. always means the 'left alt' key.
  70.  
  71. o C-space is always mapped to C-@, the set-mark command, for convenience.
  72.  
  73. o The backspace key always sends DEL (delete previous character in emacs),
  74. and DEL sends C-d (delete character under cursor). If you don't like this, 
  75. add the line
  76.     (setq amiga-remap-bsdel nil)
  77. to your .emacs file (in s:).
  78.  
  79. o Keypad keys are prefixed with C-x C-^ K (so 0 generates C-x C-^ K 0).
  80. Normally, C-x C-^ K is a do-nothing operation, so the keypad keys just
  81. insert the usual character. If you want to redefine the keypad keys, you
  82. must do the following:
  83.  
  84.   (global-set-key "\C-x\C-^K" (make-sparse-keymap))
  85.   (global-set-key "\C-x\C-^K0" '<function for key 0>)
  86.   (global-set-key "\C-x\C-^K1" '<function for key 0>)
  87.   ...
  88.  
  89. Once you have redefined one key, you must define all of them (as C-x C-^ K
  90. is no longer a do-nothing command). If you still want a keypad to insert
  91. its usual character, you can use (for +)
  92.  
  93.   (global-set-key "\C-x\C-^K+" 'self-insert-command)
  94.  
  95. o The sequences for function & arrow keys are the standard Amiga ones, 
  96. except that the initial character (CSI, code 155) is replaced by
  97. C-x C-^. For example, F1 is C-x C-^ 0 ~. You can always find the 
  98. characters generated by a key by pressing it, and then executing
  99. M-x view-lossage. This displays the last 100 characters seen by emacs. So
  100. to define F1 to be view-lossage you would add
  101.  
  102.   (global-set-key "\C-x\C-^0~" 'view-lossage)
  103.  
  104. to s:.emacs (trying to define F1 interactively with M-x global-set-key
  105. will fail ...).
  106.  
  107.  
  108. There are several extra features:
  109.  
  110. a) Mouse support, similar to the X-Windows version.
  111.  
  112. You can position the cursor with the left mouse button. Other possibilites are:
  113.  
  114. action            result
  115. ------------------------------
  116. shift-left button    set mark at mouse position
  117. control-left button    cut between point and mouse position
  118. meta-left button    copy between point and mouse position
  119. middle button        paste
  120. shift-middle button    iconify emacs window (double click to deiconify)
  121.  
  122. Some of the control, meta, etc combinations may be stolen by Intuition or
  123. commodities programs, so don't be surprised if they don't all work.
  124.  
  125. All of these actions may be redefined (this is emacs after all!), see the
  126. file lisp/amiga-mouse.el for details (you will need to learn lisp if you don't
  127. already know it ...) [Note: this file is not included in the binary only
  128. distribution, you will need the source code version].
  129.  
  130. b) Clipboard
  131.  
  132. At first glance, emacs uses the Amiga clipboard, ie it cuts to the
  133. clipboard and pastes from it (via the menu operations or the C-w
  134. (kill-region), M-w (copy-region-as-kill) & C-y (yank) commands).
  135.  
  136. Things are actually complicated by emacs use of a "kill ring" (ie it
  137. remembers the last 30 things cut. The M-y (yank-pop, menu command
  138. Paste Previous) allows you to recover old cuts):
  139.  
  140. - When you cut (or copy) something in emacs it is placed in the
  141. clipboard.
  142.  
  143. - When you paste (yank) something in emacs, it checks the clipboard to
  144. see if it contains anything new. If so, it pastes that.
  145.  
  146. [Note: It also checks the clipboard when you cut something, and saves
  147. that in the kill-ring if necessary]
  148.  
  149. All this effort is used to make the clipboard appear to operate
  150. transparently in emacs.
  151.  
  152. c) Window
  153.  
  154. By default, emacs runs in a window on the workbench screen using the
  155. system default font and the standard colours. All this can be changed:
  156.  
  157. o The font can be specified with the -fn <font> <size> option when you
  158. run emacs. You can also use the amiga-set-font command interactively,
  159. or add a line like
  160.    (amiga-set-font "topaz" 11)
  161. to your s:.emacs file. The font must be non-proportional.
  162.  
  163. o The window size and screen can be changed with the
  164. amiga-set-geometry function. It takes 4 or 5 parameters, the (x,y)
  165. position of the window and its (width,height). The last optional
  166. parameter specifies the screen: a string gives the name of a public
  167. screen, t stands for the default public screen (normally the
  168. workbench) and nil means keep the same screen. For example, the lisp code
  169.   (amiga-set-geometry 0 0 640 400)
  170. resizes the emacs window to 640x400. If the screen would be too small
  171. given the current font (there must be room for 11x4 characters), the
  172. change is refused.
  173.  
  174. To use a public screen requires an utility to create them ...
  175.  
  176. o The foreground & background colours can be changed with the 
  177. amiga-set-foreground-color & amiga-set-background-color commands. You
  178. specify the pen and not the actual colour (from 0 to 7 only,
  179. because of restrictions in console.device).
  180.  
  181. o The emacs window can be iconified (onto the workbench) with the
  182. amiga-iconify command. This is bound to shift-middle button on a 3
  183. button mouse, and to C-z (which is normally bound to suspend-emacs,
  184. which doesn't work on the Amiga).
  185.  
  186. To deiconify emacs, double click on the icon.
  187.  
  188. [Note: in this version, emacs will continue to answer to ARexx
  189. commands while iconified. The variable amiga-emacs-iconfied is
  190. set to 't' while emacs is iconified, 'nil' the rest of the time.
  191. You can test this, eg to make sure that emacs is not iconified 
  192. before reading some user input]
  193.  
  194. If you use the functions described above in s:.emacs, they will take 
  195. effect before emacs's window is opened. This will avoid the nasty
  196. visual effects of the previous version.
  197.  
  198. d) Menus
  199.  
  200. If you have installed emacs correctly (see the INSTALLATION file), it
  201. will startup with some menus containing some useful basic
  202. functions (the layout was inspired from that of TurboText, another
  203. good editor which has the disadvantage of being more expensive than
  204. emacs ...). Alongside each item is the emacs key sequence which
  205. invokes that function, if any.
  206.  
  207. Using the Menu Help functionality of AmigaDOS 2.04, you can get help
  208. on any menu item by highlighting it with the mouse and pressing the
  209. Help key [This is easier if you're left handed :-)].
  210.  
  211. The menus are not fixed, they are defined by the s:.emacs-menu.el file
  212. (which isn't human-readable). To modify them, edit s:.emacs-menu.menu.
  213. This contains a lisp-like (but quite legible even for lisp-haters)
  214. representation of the menus, which you can modify by adding items or
  215. menus. The format should be obvious (just make sure that closing
  216. brackets correspond to the correct opening ones, emacs always shows
  217. the corresponding '(' when you type a ')'. Also the last bracket
  218. should correspond with the first).
  219.  
  220. When you have finished your changes, type C-c C-c. This will save your
  221. menus, and then generate a .el file from them (this takes several
  222. seconds even on an A3000. Be patient). Then save the resulting file.
  223. To have the new menus take effect immediately, type M-C-x while in the
  224. .el file.
  225.  
  226. Enterprising lisp programmers can customise the menus even more by
  227. modifying the functions amiga-menus-dispatch and/or amiga-menus-help
  228. in lisp/amiga-mouse.el. This code basically receives a (menu-number
  229. menu-item-number) list and must take the appropriate action
  230. (currently, execute the command associated with that particular menu
  231. item). The lack of comments will surely not deter these audacious
  232. pionneers ...
  233.  
  234. e) Command line options
  235.  
  236. Beyond the standard emacs command line options (for which
  237. documentation tends to be rather sketchy, not to say missing), you can
  238. also use:
  239.  
  240. -prealloc <n>: Reserve n bytes of memory for emacs exclusively. This
  241. option *must* be the first on the command line. On the A3000, chip
  242. memory can't be used for emacs (the details are complicated ...), so
  243. you will run out of memory sooner than expected. This option allows
  244. you to reserve some for emacs before it gets eaten by other programs.
  245.  
  246. -fn <font> <size>: Set the font that emacs uses, like the
  247. amiga-set-font command (see section c, on windows). Note that there
  248. must be enough room for 11x4 characters in the standard 640x200
  249. window. So avoid fonts bigger than 40 points ...
  250.  
  251. -nw: Don't use a window, use a serial port. See part 3, Using Emacs
  252. over a serial line.
  253.  
  254. f) ARexx
  255.  
  256. Emacs has a full ARexx interface. It can execute scripts and commands
  257. synchronously (waiting for the result) or asynchronously, and has an
  258. ARexx port from which it accepts commands. 
  259.  
  260. To execute a script, you use the amiga-arexx-do-command (synchronous)
  261. or amiga-arexx-send-command (asynchronous) commands. These ask for the
  262. script file name (the default extension is .elx). If you just want to
  263. execute a simple ARexx command, you can prefix those commands with C-u
  264. and specify the string to execute.
  265.  
  266. From lisp, you must use
  267.   (amiga-send-command "<file>" nil) for a script, and
  268.   (amiga-send-command "<commands>" t) for direct execution.
  269. (and the same for amiga-do-command). The result of amiga-send-command
  270. is an integer that can be passed to amiga-arexx-wait-command to wait
  271. for the completion of the script or command. It can also be used with 
  272. amiga-arexx-check-command to check if the script has finished. For
  273. example:
  274.  
  275.   (let ((arexx-id (amiga-send-command "start-fun" nil)))
  276.     ... do something here ...
  277.     ; and wait for arexx script to end
  278.     (amiga-arexx-wait-command arexx-id))
  279.  
  280. Emacs's ARexx port accepts commands in lisp, and is usually called
  281. EMACS1 (if you run emacs twice simulatenously, the second one will
  282. have EMACS2, and so on). For example (from a shell),
  283.  
  284.   rx "address EMACS1 '(beginning-of-buffer)'"
  285.  
  286. will set point to the beginning of the buffer.
  287.  
  288. ARexx commands are only processed at certain times, so be careful how
  289. you design your applications. These are:
  290.  
  291. o While waiting for commands from the keyboard (ie when emacs is
  292. idle or iconified).
  293. o While processing a synchronous (amiga-arexx-do-command) script or
  294. waiting for a script to terminate with amiga-arexx-wait-command.
  295. o When the amiga-arexx-process function is called.
  296.  
  297. They also affect the user visible state by default (ie calling
  298. beginning-of-buffer as above modifies the user's position). Avoid
  299. sending random commands at random times, or use save-excursion.
  300.  
  301. As usual, all this behaviour can be modified to some extent. Look in
  302. amiga-init.el for details [The source code is the documentation...].
  303.  
  304. I still haven't written any significant examples, so ...
  305.  
  306. g) Workbench support
  307.  
  308. Beyond iconification (see the section on the emacs window), emacs 
  309. supports a number of features for Workbench users:
  310.  
  311. - emacs can be run from the Workbench, by all the usual methods
  312.   (double clicking on the tool, double clicking on a project which
  313.   has temacs as its default tool, etc). All the projects that are
  314.   passed to temacs will be loaded (if they are files), or listed 
  315.   with dired (if they are directories).
  316.  
  317. - icons can be dropped in emacs's window, the corresponding file
  318.   or directory will be loaded or listed.
  319.  
  320. - icons can be created for files that are saved. This is the default
  321.   when emacs is run from the workbench. This is controlled by the
  322.   amiga-create-icons variable: if you always want icons to be
  323.   created, add
  324.  
  325.     (setq amiga-create-icons t)
  326.  
  327.   to s:.emacs, or
  328.  
  329.     (setq amiga-create-icons nil)
  330.  
  331.   if you never want them.
  332.  
  333. h) external processes
  334.  
  335. This version of emacs fully supports synchronous (used to get the
  336. result of ls for dired, for instance) and asynchronous (as in the
  337. 'shell' command) processes. However, it requires Matt Dillon's
  338. 'fifo.device' and 'fifo:' devices to function. See the INSTALLATION
  339. file for details.
  340.  
  341. This allows full support for all emacs functions which call external
  342. programs, providing that said programs exist on the Amiga. The
  343. following work:
  344.   compile (for SAS C 5.10b, with a few occasional problems)
  345.   grep
  346.   shell (but see the discussions below)
  347.   display-time
  348.   dired
  349.   list-directory
  350.   sort-...
  351.  
  352. The compile command sometimes has problems finding file names in the
  353. error messages, and tries to read the current directory instead. If
  354. you are patient, it moves on to the next file.
  355.  
  356. Because of differences between AmigaDOS & Unix, sending signals (eg
  357. interrupt, kill) to processes is not very reliable. The following
  358. points must be kept in mind:
  359.  
  360. - In some unlikely cases, the appropriate process to signal won't be 
  361.   found. 
  362. - The stop-process & continue-process functions don't work.
  363. - interrupt-process & quit-process send a ctrl-c & ctrl-d to the
  364.   process and all its children (probably).
  365. - kill-process also sends a ctrl-c & ctrl-d. It then pretends that
  366.   the process has died.
  367.  
  368. All input sent to a process after an end-of-file is ignored. The process
  369. just sees an endless sequence of end-of-files. This is most visible with
  370. the shell command, where if you send an end-of-file to a program (eg type)
  371. with C-c C-d, the shell will exit. The bug is in fifo.device, not in emacs.
  372.  
  373. The input & output of processes run inside emacs look like interactive
  374. files (which allows, for instance, shells to run correctly). However, this
  375. confuses some programs which expect all interactive files to be Amiga
  376. consoles and causes them to crash. Several versions of ls suffer from this
  377. problem (they run into problems while trying to get the window size).
  378.  
  379. amiga-process-stack-size is the size of the stack for new processes. If it
  380. is 0 (the default), emacs's stack size is used.
  381.  
  382.  
  383. 4. Using emacs over a serial line
  384. ---------------------------------
  385.  
  386. To use emacs over a serial port, you must do:
  387.  
  388.   setenv TERM <terminal type> (eg vt100)
  389.   emacs -nw
  390.  
  391. The setenv line can be put in your User-Startup, so as to avoid typing
  392. it every time.
  393.  
  394. Emacs cannot simply guess how your terminal works from its name, it
  395. needs a description of it. This is found in a termcap file, which
  396. emacs looks for in s:termcap. If you didn't install this file with emacs,
  397. you can do so by typing (in a CLI):
  398.  
  399.   join gnuemacs:etc/termcap.ucb gnuemacs:etc/termcap.amiga as s:termcap
  400.  
  401. [Note: These files only come with the source version]
  402.  
  403. The -nw prevents the use of a window.
  404.  
  405. If you have several serial ports, you can type
  406.  
  407.   emacs -dev ser2.device 2
  408.  
  409. to use port 2 of device ser2.device. Use of the -dev option implies -nw.
  410.  
  411. These options (-dev & -nw) *must* be specified at the start of the
  412. command line.
  413.  
  414. The descriptions of the Clipboard, the command line options and the
  415. ARexx port in part 2 above also apply to use over a serial port.
  416.  
  417.  
  418. 5. Redumping emacs [This section for expert users only]
  419. -------------------------------------------------------
  420.  
  421. Enterprising users may want to change the lisp files which are loaded
  422. into the Emacs dump file. The procedure for doing this is very similar
  423. to that with the Unix version, except that the amount of pure storage
  424. can be changed without recompiling emacs. This will allow users
  425. without SAS C v5.10b to still make such changes.
  426.  
  427. The necessary lisp files are only included in the source distribution,
  428. so you will have to get that first. Once that is available, that you
  429. have made all your changes (eg adding some extra files to be dumped),
  430. use the following sequence to redump emacs:
  431.  
  432.   cd gnuemacs:etc
  433.   stack 20000
  434.   /temacs -pure <n> -malloc <m> -nl -batch -l loadup dump
  435.  
  436. The -pure <n> and -malloc <m> options should only be necessary if you
  437. add extra files to be dumped, see below how to choose values for n &
  438. m. The above order for the parameters must be preserved. Specifying
  439. dump without -nl & -batch will have unpredicatable consequences.
  440.  
  441. Once all the files are loaded, a new copy of gnuemacs:etc/EMACS-DATA
  442. will be saved, and all should work correctly. If you get one of the
  443. following messages:
  444.  
  445.   Pure Lisp storage exhausted
  446.  
  447.   Emacs dump: ran out of memory for malloc.
  448.  
  449. read the following description of the -pure & -malloc options:
  450.  
  451. When emacs is dumped, it saves (amongst other things) the copies of
  452. two zones of memory, called the pure storage area and the malloc hunk.
  453. These contain an internal representation of the lisp code, so the more
  454. code you include in a dumped emacs, the bigger these need to be. The
  455. default sizes of these are reasonable sizes for the standard lisp code
  456. which is dumped, but you will probably need to increase them if you
  457. add some more lisp modules. The best way to find the new values for n
  458. (size of pure area) and m (size of the malloc hunk), is to run the
  459. command
  460.  
  461.   cd gnuemacs:etc
  462.   stack 20000
  463.   /temacs -pure 200000 -malloc 200000 -nl -batch -l loadup dump
  464.  
  465. (these sizes should be largely sufficient, but if you still get one of
  466. the two error messages above, increase them). Then run emacs as usual,
  467. and look at the values of the 2 lisp variables
  468.  
  469.      pure-bytes-used
  470. and  amiga-malloc-bytes-used
  471.  
  472. pure-bytes used contains the minimum value for n, and
  473. amiga-malloc-bytes-used the minimum value for m. Add 1000 to these for
  474. luck to get values for n and m, and redump emacs using these.
  475.  
  476. For those who are into modifying the C source, the default values are
  477. 130000 for n (see DEF_PURESIZE in s-amiga.h) and 92000 for m (see
  478. MALLOC_HUNK_SIZE in amiga.h).
  479.  
  480. 6. Source
  481. ---------
  482.  
  483. Source for emacs and all the programs included with it should be
  484. obtainable from the same place as this file. If not, please send me
  485. mail (if you are on the Internet) and I will provide the missing
  486. pieces. Specifically, there should be:
  487.  
  488. - The emacs sources
  489. - Sources for the 'unix library' needed to compile emacs
  490. - Source for the programs in the c directory (ls, sort, rmdir, grep).
  491. This consists of the GNU fileutils, textutils and grep packages.
  492.  
  493. Distributing the binary without these packages is a violation of
  494. the GNU General Public License (see the file COPYRIGHT in the etc
  495. directory) under which emacs is distributed.
  496.  
  497. 7. Thanks & Problems
  498. --------------------
  499.  
  500. I would like to thank the following people for their help while debugging
  501. emacs:
  502.  
  503. - Philippe Morel & Jean-Marc Vandel for early and late testing respectively.
  504. - Jukka Partanen, Alan Bair, Michael Witbrock, Hugh D. Gamble and several
  505. others for beta-testing.
  506.  
  507. Please send any bug reports, enhancement requests, etc to:
  508.  
  509. Post:                E-mail:
  510. David Gay            dgay@di.epfl.ch
  511. 19 Chemin de la Source
  512. CH-1296 Coppet
  513. Vaud
  514. Switzerland
  515.  
  516. 8. Ordering Information
  517. -----------------------
  518.  
  519. I can provide a complete copy of my development directory, which
  520. includes:
  521.  
  522. o the standard emacs-18.58 files
  523. o modified and new lisp files
  524. o Amiga-specific source, as text and in RCS format (highlighting the
  525. changes from a standard unix distribution, and the different versions).
  526. o assorted lisp packages hacked for the Amiga (I will be posting some
  527. of these in due course):
  528.   - a tags-like access to the 2.0 autodocs (you must already have a
  529.     copy of these ...)
  530.   - gnus (a news reader) for use with Matt Dillon's uucp package. 
  531.   - getris, a tetris clone for emacs
  532.  
  533. All these as a tar file on a QIC-150 tape, for $200 (the same price as
  534. the FSF, so as not to undercut them), or 300SF. This price is valid
  535. until the 31st December 1993, and includes shipping by surface mail.
  536.  
  537. Please send all orders, by postal mail, to
  538.  
  539.   David Gay
  540.   19 Chemin de la Source
  541.   CH-1296 Coppet
  542.   Vaud
  543.   Switzerland
  544.  
  545.   Tel: +(41)-22 776 35 81 [Evenings, Central European Time]
  546.   Fax: +(41)-22 776 70 58
  547.  
  548. Include with your order:
  549. - A cheque, in dollars or Swiss francs.
  550. - Your *complete* address (don't forget the country, etc).
  551. - A phone or fax number so I can contact you if I have any problems.
  552.  
  553. I will be glad to include, on request, and with full source, some
  554. other pieces of software I have written:
  555. - An HP11 calculator (this is an update to the version available on
  556. fish disks, with some bug fixes and 2.0 specific features).
  557. - A scheme compiler for the Amiga, still in an alpha state.
  558. - A fortune cookie program, including 1 megabyte of cookies (merged
  559. from various sources).
  560.  
  561.  
  562. Dvaid Gay
  563. dgay@di.epfl.ch
  564. Ecole Polytechnique Federale de Lausanne - Switzerland
  565. Laboratoire d'Informatique Technique
  566.